<script setup lang="ts">
const route = useRoute();
const { id } = route.params;

definePageMeta({
    // 路由参数的验证
    validate: route => {
        const { id } = route.params;

        console.log(id);

        // 只校验数字，其他的禁止
        // return /^\d+$/.test(id.toString());
        // return true;

        return false;
    },
});
</script>

<template>
    <div>动态路由 id = {{ id }}</div>
</template>

<style scoped lang="scss"></style>
